package com.classtest.DemoExpend.service.Impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.classtest.DemoExpend.bean.DbUser;
import com.classtest.DemoExpend.dao.DbUserDao;
import com.classtest.DemoExpend.service.DbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DbUserServiceImpl extends ServiceImpl<DbUserDao, DbUser> implements DbUserService {

    @Autowired
    DbUserDao dbUserDao;

    @Override
    public List<DbUser> getUserByMessage(String json) {
        DbUser dbUser = JSONObject.parseObject(json,DbUser.class);
        return dbUserDao.getUserByMessage(dbUser);
    }
    public List<DbUser> getPersonalInfo(String json){
        DbUser dbUser = JSONObject.parseObject(json,DbUser.class);
        return dbUserDao.getPersonalInfo(dbUser);
    }
    public void updatePersonalInfo(String json){
        dbUserDao.updatePersonalInfo(JSONObject.parseObject(json, DbUser.class));
    }
}
